<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'user-form',
	'enableAjaxValidation'=>false,
	'htmlOptions' => array( 'enctype'=>'multipart/form-data' ),
)); ?>

	<p class="hint">Поля с <span class="required">*</span> обязательны для заполнения.</p>

	<?php echo $form->errorSummary($model); ?>
	
	<?php if(!$update): ?>
	<div class="row">
		<?php echo $form->labelEx($model,'username'); ?>
		<?php echo $form->textField($model,'username',array('size'=>60,'maxlength'=>80)); ?>
		<?php echo $form->error($model,'username'); ?>
	</div>
	<?php endif; ?>

	<div class="row">
		<?php echo $form->labelEx($model,'password'); ?>
		<?php echo $form->passwordField($model,'password',array('size'=>60,'maxlength'=>45)); ?>
		<?php echo $form->error($model,'password'); ?>
	</div>

	<? /*
	<div class="row image" id="avatar">
		<?php echo $form->labelEx($model,'_avatar'); ?>
		<?php $this->widget('ext.imageform.EImageForm', array(
			'id'=>'avatar',
			'model'=>$model,
			'name'=>'avatar',
			'title'=>'Аватар '.$model->username,
		)); ?>
		<p class="hint">Картинка будет автоматически сжата до 100 пикселей по ширине и/или высоте.</p>
		<?php echo $form->error($model,'_avatar'); ?>
	</div>
	*/ ?>

	<div class="row">
		<?php echo $form->labelEx($model,'email'); ?>
		<?php echo $form->textField($model,'email',array('size'=>60,'maxlength'=>80)); ?>
		<?php echo $form->error($model,'email'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'status'); ?>
		<?php echo $form->dropDownList($model,'status', Lookup::items('UserStatus')); ?>
		<?php echo $form->error($model,'status'); ?>
	</div>
	
	<div class="row">
		<?php echo $form->labelEx($model,'logged'); ?>
		<?php
		$this->widget('ext.timepicker.TimePicker', array(
			'id'=>'logged',
			'model'=>$model,
			'name'=>'logged',
			'options'=>array(
				'duration'=>'',
				'showTime'=>true,
				'time24h'=>true,
				'dateFormat'=>'yy-mm-dd',
				'firstDay' => 1,
				'stepMinutes'=>5,
				'showOn'=>'button',
				'changeMonth'=>true,
				'changeYear'=>true,
			),
		));
		?>
		<?php echo $form->error($model,'logged'); ?>
	</div>
	
	

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Добавить' : 'Сохранить'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->
